home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue30 / clinic / ImgTestU.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-12-07  |  1.1 KB  |  57 lines

  1. unit ImgTestU;
  2.  
  3. interface
  4.  
  5. uses
  6.   Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, DBCtrls, Db, Grids, DBGrids, DBTables;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Button1: TButton;
  12.     Table1: TTable;
  13.     DBGrid1: TDBGrid;
  14.     DataSource1: TDataSource;
  15.     DBImage1: TDBImage;
  16.     OpenDlg: TOpenDialog;
  17.     Table1SpeciesNo: TFloatField;
  18.     Table1Category: TStringField;
  19.     Table1Common_Name: TStringField;
  20.     Table1SpeciesName: TStringField;
  21.     Table1Lengthcm: TFloatField;
  22.     Table1Length_In: TFloatField;
  23.     Table1Notes: TMemoField;
  24.     Table1Graphic: TGraphicField;
  25.     procedure Button1Click(Sender: TObject);
  26.   private
  27.     { Private declarations }
  28.   public
  29.     { Public declarations }
  30.   end;
  31.  
  32. var
  33.   Form1: TForm1;
  34.  
  35. implementation
  36.  
  37. {$ifdef Ver100}
  38. uses
  39.   JPEG;
  40. {$endif}
  41.  
  42. {$R *.DFM}
  43.  
  44. procedure TForm1.Button1Click(Sender: TObject);
  45. begin
  46.   if OpenDlg.Execute then
  47.   begin
  48.     Table1.Insert;
  49.     Table1Graphic.LoadFromFile(OpenDlg.FileName);
  50.     Table1Common_Name.Value :=
  51.       ExtractFileName(OpenDlg.FileName);
  52.     Table1.Post
  53.   end
  54. end;
  55.  
  56. end.
  57.